Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent using future dates for LastSenAt and BackoffAt #1089

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

alanhamlett
Copy link
Member

When a users' clock time is changed to the future temporarily, the timestamps saved in wakatime-internal.cfg can be accidentally set to a date far in the future. This causes wakatime-cli to stop sending heartbeats until reaching that date in the future.

The fix is to never parse backoff or lastSentAt as future dates.

@alanhamlett alanhamlett added the bug Something isn't working label Sep 14, 2024
@alanhamlett alanhamlett self-assigned this Sep 14, 2024
@alanhamlett alanhamlett force-pushed the bugfix/future-dates branch 2 times, most recently from 634d704 to 9fdfdd9 Compare September 14, 2024 08:05
@alanhamlett alanhamlett merged commit f231541 into develop Sep 14, 2024
21 checks passed
@alanhamlett alanhamlett deleted the bugfix/future-dates branch September 14, 2024 11:08
Copy link

codecov bot commented Sep 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.01%. Comparing base (7b8aaba) to head (ec9a897).
Report is 2 commits behind head on develop.

@@             Coverage Diff             @@
##           develop    #1089      +/-   ##
===========================================
+ Coverage    63.00%   63.01%   +0.01%     
===========================================
  Files          383      383              
  Lines        16508    16514       +6     
===========================================
+ Hits         10401    10407       +6     
  Misses        5539     5539              
  Partials       568      568              
Flag Coverage Δ
unittests 63.01% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cmd/params/params.go 86.07% <100.00%> (+0.10%) ⬆️

@alanhamlett alanhamlett mentioned this pull request Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant